<%--
  Created by IntelliJ IDEA.
  User: 30890
  Date: 2023/4/26
  Time: 20:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <style>
        #content {
            max-width: 800px;
            margin: 0 auto;
        }

        #innerAddTaskFrame {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        h1 {
            text-align: center;
            color: #333;
        }

        form {
            text-align: center;
        }

        textarea {
            width: 100%;
            height: 160px;
            padding: 10px;
            margin-top: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-sizing: border-box;
        }

        input[type="submit"] {
            width: 200px;
            height: 40px;
            margin-top: 20px;
            background-color: #4CAF50;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        input[type="submit"]:hover {
            background-color: #45a049;
        }

        #error {
            color: #dd1144;
            font-size: 15px;
        }
    </style>
</head>
<body>
<div id="content">

    <div id="innerAddTaskFrame">
        请作答：<br><br>
        <form action="student.action?action=dealAnswer&taskAccount=${taskAccount}" method="post" onsubmit="return isDeal()">
            <textarea id="answer" style="width: 600px;height: 160px;font-size: 25px;color: grey" rows="4" name="answer">

            </textarea>
            <br> <br> <br>
            <input style="margin-left: 350px" type="submit" value="点击添加">

        </form>
        <span style="margin-left: 320px;font-size: 15px;color: red">${tip}</span>


    </div>

</div>
<script>
    function isDeal() {
        let text = document.getElementById("answer").value;
        if(text.trim()==""||text==null){
            alert("答案不能为空");
            return false;
        }else {
            return true;
        }
    }
</script>


</body>
</html>
<script>


</script>
